package com.yowasa.xiuxian.engine.battle.buff;

import com.yowasa.xiuxian.annoations.Buff;
import com.yowasa.xiuxian.entity.bo.battle.BattleContent;
import com.yowasa.xiuxian.entity.bo.battle.BuffContent;
import com.yowasa.xiuxian.entity.bo.battle.UserBattleContent;


@Buff(name = "妨害")
public class FangHaiBuff implements BuffInterface {

    //回合开始时额外结算
    public void beforeBuffAction(UserBattleContent first, UserBattleContent second, BattleContent content) {
        BuffContent buff = first.getBuff().get("妨害");
        if(buff.getNum() >= 1){
            int v = first.getBattleInfo().getHp()/10;
            first.getBattleInfo().setChp(Math.max(first.getBattleInfo().getChp() - v,0));
            content.getMsgLog().add(first.getUserBO().getName() + "因环境失去了"+v+"点hp");
        }

    }


}
